#include "ClippingPlane.h"
#include "General Utils.hpp"

ClippingPlane::ClippingPlane()
{
	m_ClippingPlane.x = 0;
	m_ClippingPlane.y = 0;

	m_ClippingPlane.height = DataLoader->WINDOW_HEIGHT;
	m_ClippingPlane.width = DataLoader->WINDOW_WIDTH;
}

void ClippingPlane::Translate(int x, int y)
{
	m_ClippingPlane.x += x;
	m_ClippingPlane.y += y;
}

bool ClippingPlane::IsInPlane(const GameRectangle& aRect)
{
	return Intersects(m_ClippingPlane, aRect);
}

bool ClippingPlane::IsInPlane(const SDL_Rect& aRect)
{
	GameRectangle aRectangle(aRect.x, aRect.y, aRect.w, aRect.h);
	return IsInPlane(aRectangle);
}
void ClippingPlane::SetX(int val)
{
	m_ClippingPlane.x = val;
}

void ClippingPlane::SetY(int val)
{
	m_ClippingPlane.y = val;
}